import React from 'react';

import {Link} from 'react-router';

import Header from '../common/Header';


class MainView extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            titie:''
        };
    }

    componentDidMount() {

    }

    clickHandler = () =>{
        this.context.router.push('/app');
    };

    render() {
        return (
            <div className="content">
                <Header title="这是一个示例"/>
                <div className="content_main">
                    <p>
                        这是首屏页面
                    </p>
                    <p>
                        <button onClick={this.clickHandler}>跳转到APP</button>
                        <Link to="/app">跳转到APP</Link>
                    </p>
                </div>
            </div>
        );
    }
}

MainView.contextTypes = {
    router: React.PropTypes.object
};

export default MainView;